//
//  SringExtension.swift
//  CocoProject
//
//  Created by Ruthless on 2023/8/28.
//

import Foundation
import UIKit
//import CryptoSwift
//private let aesKey = "1b6ad9fedbc640e6"

extension String {
    var dic: [String: Any]? {
        guard let data = self.data(using: .utf8) else { return nil }
        guard let object = try? JSONSerialization.jsonObject(with: data) as? [String: Any] else { return nil }
        
        return object
    }
    
    var array: [[String: Any]]? {
        guard let data = self.data(using: .utf8) else { return nil }
        guard let object = try? JSONSerialization.jsonObject(with: data) as? [[String: Any]] else { return nil }
        
        return object
    }
    
//    var encodeAES: String {
//        do {
//            let aes = try AES(key: aesKey.bytes, blockMode: ECB(), padding: .pkcs5)
//            let encodeString = try self.decryptBase64ToString(cipher: aes)
//            return encodeString
//        } catch {
//            return ""
//        }
//    }
    
}

